/*
 @coding  : utf-8
 @Time    : 2023/4/20 15:18
 @Author  : Rumou
 @File    : 切片相同元素统计.go
 @Description:
*/

package main

import "fmt"

func main() {
	slice1 := []string{"aaa", "bbb", "ccc", "ddd", "eee"}
	slice2 := []string{"bbb", "ccc", "fff"}
	count := 0
	for i := 0; i < len(slice1); i++ {
		for j := 0; j < len(slice2); j++ {
			if slice1[i] == slice2[j] {
				count += 1
			}
		}
	}
	fmt.Printf("切片1:%v\n切片2:%v\n相同元素的个数:%d", slice1, slice2, count)
}
